package cn.yj.frame.config;

import cn.yj.frame.spring.BeanUtils;
import cn.yj.frame.spring.anotation.RpcReferenceAnnotationBeanHandlerProcessor;
import cn.yj.frame.spring.anotation.RpcServiceAnnotationBeanHandlerProcessor;
import cn.yj.frame.spring.event.RpcSpringBeanPostProcessor;
import cn.yj.register.RpcProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 永健
 * @since 2022-01-18 21:58
 */
@Configuration
public class BeanConfig {

	@Bean
	public BeanUtils beanUtils() {
		return new BeanUtils();
	}

	@Bean
	public RpcServiceAnnotationBeanHandlerProcessor rpcAnnotationBean(RpcProperties properties) {
		return new RpcServiceAnnotationBeanHandlerProcessor(properties);
	}

	@Bean
	public RpcReferenceAnnotationBeanHandlerProcessor referenceAnnotationBeanPostProcessor() {
		return new RpcReferenceAnnotationBeanHandlerProcessor();
	}

	@Bean
	public RpcSpringBeanPostProcessor rpcSpringBeanPostProcessor() {
		return new RpcSpringBeanPostProcessor();
	}

}
